#include "hplczkyspumpsendpacket.h"
#include "hplczkyspumpprotocoldata.h"
#include "common/hplczkyspfcid.h"
#include "common/hplczkysmakepacket.h"
#include "common/hplczkyscheckpacket.h"

namespace hplc
{
namespace zkys
{

HplcZkysPumpSendPacket::HplcZkysPumpSendPacket(HplcZkysPumpProtocolData &data, QObject *parent)
    : HplcZkysSendCommonPacket (data, parent)
{

}

HplcZkysPumpSendPacket::~HplcZkysPumpSendPacket()
{

}

void HplcZkysPumpSendPacket::setFlow(float flow)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_FLOW), flow);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getFlow()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_FLOW));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setFlowPercent(quint8 percent)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_FLOW_PERCENT), percent);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getFlowPercent()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_FLOW_PERCENT));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPressMin(float press)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PRESS_MIN), press);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPressMin()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PRESS_MIN));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPressMax(float press)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PRESS_MAX), press);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPressMax()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PRESS_MAX));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPressWarning(float press)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PRESS_WARNING), press);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPressWarning()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PRESS_WARNING));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setStartStop(quint8 flag)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_START_STOP), flag);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getStartStop()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_START_STOP));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPauseRestore(quint8 flag)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PAUSE_RESTORE), flag);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPauseRestore()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PAUSE_RESTORE));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPurge(quint8 flag)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PURGE), flag);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPurge()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PURGE));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPurgeFlow(float flow)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PURGE_FLOW), flow);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPurgeFlow()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PURGE_FLOW));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPurgeTime(quint8 time)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PURGE_TIME), time);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPurgeTime()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PURGE_TIME));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPressZero()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PRESS_ZERO));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPressZeroVoltage()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PRESS_ZERO));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPressUploadFreq(quint8 factor)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PRESS_UPLOAD_FREQ), factor);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPressUploadFreq()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PRESS_UPLOAD_FREQ));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPressCompen(quint8 flag)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_FLOW_PRESS_COMPEN), flag);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPressCompen()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_FLOW_PRESS_COMPEN));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setMode(quint8 mode)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_MODE), mode);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getMode()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_MODE));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setPress(float press)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_PRESS), press);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getPress()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_PRESS));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::setRunMode(quint8 mode)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_RUNMODE), mode);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::getRunMode()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_RUNMODE));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetFlowMax(float flow)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_FLOW_MAX), flow);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetFlowMax()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_FLOW_MAX));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetFlowMin(float flow)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_FLOW_MIN), flow);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetFlowMin()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_FLOW_MIN));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetPressThreshold(float press)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_PRESS_THRESHOLD), press);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetPressThreshold()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_PRESS_THRESHOLD));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetPressSet(float press)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_PRESS_SET), press);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetPressSet()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_PRESS_SET));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetPID(float p, float i, float d)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_PID), p, i, d);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetPID()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_PID));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetPressPIDOut(float press, float pidOut)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_PRESS_PIDOUT), press, pidOut);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetPressPIDOut()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_PRESS_PIDOUT));
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_SetPressPIDOutUploadFreq(uint8_t freq)
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_PUMP_CP_PRESS_PIDOUT_UPLOAD_FREQ), freq);
    m_d->m_checker->sendRetry();
}

void HplcZkysPumpSendPacket::CP_GetPressPIDOutUploadFreq()
{
    HplcZkysPumpProtocolData *m_d = static_cast<HplcZkysPumpProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_PUMP_CP_PRESS_PIDOUT_UPLOAD_FREQ));
    m_d->m_checker->sendRetry();
}

} // zkys
} // hplc
